//
//  main.m
//  正则表达式
//
//  Created by song on 15/8/31.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import <Foundation/Foundation.h>


void regex()
{
    
    NSString *name =@"599943";
    NSString *pattern = @"[0-9]";
    NSRegularExpression *regx = [[NSRegularExpression alloc] initWithPattern:pattern options:0 error:nil];
    NSArray *results  = [regx matchesInString:name options:0 range:NSMakeRange(0, name.length)];
    
    
    for(NSTextCheckingResult *result  in results)
    {
        NSString *word =[name substringWithRange:result.range];
        NSLog(@"%@\n", word);
    }
}

int main(int argc, const char * argv[]) {
    NSString *str =[[NSString alloc] initWithFormat:@"abc"];
    NSString *test =str;
    NSLog(@"str count is %lu , test count is %lu",[str retainCount] ,[test retainCount] );
    
    return 0;
}
